package com.lut.edu.apm.payCenter.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author Zhao Suzhen
 * @date `2024/3/28`
 */
/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000135668312";
    // 设置卖家支付宝用户ID
    public static String seller_id = "2088721032649927";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCo6aMR0wau72ipwMCXkwcXYALdLuKB3HPPVq6tDKwIztiUCtJGGC/5pJmKwZLjLicTI8tvSjetLTgfUpyOwxOwERSBqDLqvSHeIxVHSHdR1HZUA1N/nMeTpK4S1T8p4vtPt7Q8nZ2ubyg5pGIGqrltAT83pwKx9K+ya9py70CkHJRVyZXTlb30I4d0efhR3Kp54/+eEaKKe6agUo6w3XXHrANF8HCBvx6aCwLTTWICaUnAj6X02OJIZ3X85Cblmey7jfAIlGWxoNJK9sKfCyO6uDsGFhkSIJhtQHMaNZ7WsCU3El7iPfaVMCWwKPDPeSzv6jmDDI4swSaNH/JwAgqzAgMBAAECggEAJQdq7zpiybDEMgqGbfQWZuJuXkyr7SoF3Vs0Wc1gXWHzCqlApYsh4UlbO5bp+5GfkUuUimYrxHQYTI2Qsp9DTqK/6xiTaPBjX04zmPfi6HZ6JjrAcEZPXieI3aoP+b+/th8gjPVEnvvRRqmpr6p3kdTnJe0f4yEv7x5DulSGyDL77gE3bV4fywetsXQg67v+XJF9/yrhzWXU2OrLCdDh1uFKoC3D/Jv1K5WYRjC3Tmd9xm7JrdcypOdh5GPZYf6i56kYqef4hKjKjh3ehlRa2b/bEzjhiZi28YDMwRB5G8b7McGUvTdX+6+d7T6mSdW213r/V3PgDf2cwjVDHnc4uQKBgQDpXdUlnFVxTtXynDPtBztll2njvQGOCK/QGk5VxTLz2uzyhHfxn7Vko9W3XY200YKtAwLnG0OqbOORAKNhCpe7kohLzLBeKwOQ+4y/rxMAfVP97bMnaGTPUaNPkh3W76Xg30C58rna93iIVcjvYQHHlCNEd881XAvel+DqaYtVbwKBgQC5S4Dyvpv9uW3/mAFLERhd8gkFnKjJQQg4jFSoBs4iEJzl7eKxDbHQNSFAWFAEKVlupSDVgQbNnwCzHXi1pLJ0ncByMwF520z169qdGbhu0xK4vLp0mn5/bIzv5UxKC5EQtZovFkCSYGkYTc15QMeIML+DHxqApGrAE5K4M+Uk/QKBgDVH4iljJzLmj/yDY2ujshEA4AFKHvfBzfpSdz4n9vksK9s3GXeGQlEHAv2Jk5gMGazMujXvyKQ5lj9+CM9YLsp5qzq7Mi1d3sOUW09Mdqcu9iVMxxGhSRr4hbPeJYf0UUglUM7jt0FiLRfbljPpTxG1JdQ1Eo8ZQ/B/dq+uh0xrAoGAXpUw7DfpzljR0k8YEeZXBtVeT5QJADoG5T6Uk/RtUiwiuqd0OKZh5oLIR10M8yLcOMNngDRNcbZBGCzqCeZZBXfk3SY2EaqknT9YJysS3tc1TkFf99dIzOhvBKGKEJ3Y3aulWXXFXjKCUtqcENHFSDqB939v+sxyhTs4gHhU9k0CgYEAkupeSTdPzDVbo9DgtDnJz6hOnfR1/LVLMlvYqBBFOH9sKJ+nGV1+5QI2MrjB5B3ARJgzozKr5e86SWvl6Z/d+2mOZZW5onDesMakoqdZccayJZWuuawG1J9/Cv7nxMS1+9cKME/O9B2ZG1CnxT5X+5aKzwrYrj7FipafnHzTc34=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvQZnIfY9qbtKnH72c7NR4oMkccxu5Frbx2R8P0+n8f7P+sD9lyBlZIZJ8ZEuM5XckfZBia/PZYBq3O2m0DFEKC4VO/nfW58jpB4yh7NM1ywH2JGWYOPwmRPLUCZscGHe/s5vdlmPy7e1iUrFvPrUbmOyeL/FjDU+lBsvXhs5hLBrAfQb70ObagaU2x4JfYdtRmsarDGxkWChj9x0jw2ghFEGc8pmY/h8RtsUyo+MuDh/2YquxX3mZh7UI8DwMsrxlzXfDiJfwMWY0FKruzn1sAiz4db2HQ552rQ8JNQ4FtKsE/tRcvywWlfoe0oAT2J+tn2CwUMwnPM1x8MbwilosQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/productPayment";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/productPayment";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\AutoPayMart\\webCenter\\log\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


